<?php
namespace Ccc\Gal\Controller;

/*                                                                        *
 * This script belongs to the FLOW3 package "Ccc.Gal".                    *
 *                                                                        *
 *                                                                        */

use TYPO3\FLOW3\Annotations as FLOW3;

/**
 * Standard controller for the Ccc.Gal package 
 *
 * @FLOW3\Scope("singleton")
 */
class StandardController extends \TYPO3\FLOW3\Mvc\Controller\ActionController {

 	/**
 	 * @FLOW3\Inject
	 * @var \Ccc\Gal\Domain\Repository\GalleryRepository
	 */
	protected $galleryRepository;
	
	/**
	 * @FLOW3\Inject
	 * @var \Ccc\Gal\Domain\Repository\ImageRepository
	 */
	protected $imageRepository;
	
	/**
	 * Index action
	 *
	 * @return void
	 */
	public function indexAction() {
		$this->view->assign('gallerynames', $this->galleryRepository->findAll());
		$this->view->assign('images', $this->imageRepository->findAll());	
	}
	
	/**
	 * Show action
	 * @param \Ccc\Gal\Domain\Model\Gallery $gallery
	 * @return void
	 */
	public function showAction(\Ccc\Gal\Domain\Model\Gallery $gallery) {
		$this->view->assign('gallerynames', $this->galleryRepository->findAll());	
		$this->view->assign('gallery', $gallery);
	}

}

?>